<template>
  <div>
    <video :src="downloadFileStream('1891038279648694273')" muted="muted" autoplay="autoplay" loop />
    <div class="main">
      <h1>智慧乡村教师{{ getCurrentYear() }}招聘中</h1>
      <h2>期待你的加入</h2>
      <el-button type="default" class="btn" round @click="toPage">点击投递</el-button>
    </div>
  </div>
</template>

<script>
import { downloadFileStream } from '@/utils/file'
export default {
  methods: {
    downloadFileStream,
    getCurrentYear() {
      return new Date().getFullYear()
    },
    toPage() {
      this.$router.push('/post')
    },
  },
}
</script>

<style lang="scss" scoped>
* {
  margin: 0;
  padding: 0;
}

video {
  position: absolute;
  left: 50%;
  top: 50%;
  /*保证视频内容始终居中*/
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100vh;
  object-fill: cover;
  min-height: 800px;
}
.main {
  top: 60px;
  height: 100vh;
  position: relative;
  z-index: 1;
  h1,
  h2 {
    color: #fff;
    text-align: center;
  }
  h1 {
    margin-top: 15%;
  }
  h2 {
    margin-top: 5%;
  }
  .el-button {
    width: 8%;
    height: 3rem;
    margin-left: 46%;
    margin-top: 5%;
  }
}
</style>
